Skip to content

fix(pm-stack): validate args before the sync-decision-events kill switch - #10113

Merged
dezren39 merged 1 commit into
mainfrom
queue/fallback-9794-killswitch
Nov 14, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/fallback-9794-killswitch

Conversation

@dezren39

@dezren39 dezren39 commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Fixes #9794.

What

sync-decision-events.ts: parseArgs() now runs before the DECISION_EVENTS_SYNC=0 kill-switch return in main(). This is the Codex P1 from PR #9341: with the old order, a disabled invocation never validated its command line, so --targte webhook silently exited 0 — violating the operator-script contract (root AGENTS.md) that every unaccounted-for argument produces a non-zero usage error.

Verification (behavioral, on this branch)

  • DECISION_EVENTS_SYNC=0 bun scripts/sync-decision-events.ts --targte webhook → exit 2 with the usage error (was exit 0 before the fix).
  • DECISION_EVENTS_SYNC=0 bun scripts/sync-decision-events.ts --dry-run → exit 0, prints the disabled message, no-op.
  • Enabled + --targte webhook → exit 2 (unchanged).
  • Enabled + --outbox-dir <empty> --dry-run → exit 0, normal dry-run output (the reorder does not disturb the working path).
  • test/decision-events.test.ts + test/decisions.test.ts: 43 pass.

Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Bug Fixes
    • The decision-events sync command now validates its arguments even when syncing is disabled. Invalid arguments produce a usage error, while valid disabled invocations continue to exit successfully.

…tch (#9794)

parseArgs() now runs ahead of the DECISION_EVENTS_SYNC=0
return in main(), so a disabled invocation with a typo flag
exits 2 with the usage error instead of silently succeeding -
the operator-script contract from root AGENTS.md (Codex P1 on
PR #9341). Verified: disabled+invalid -> 2, disabled+valid ->
0 no-op, enabled paths unchanged.
@dezren39
dezren39 requested a review from a team as a code owner November 14, 2026 16:09
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-14T16:09:57.295244Z
We couldn’t complete this review. Comment @codex review to try again.
653e1b8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

main now parses arguments before checking DECISION_EVENTS_SYNC=0. Invalid arguments produce a usage error when syncing is disabled. Valid disabled invocations still return 0.

Changes: Decision event sync validation

Layer / File(s) Summary
Argument validation before kill switch
pm-stack/aggregator/scripts/sync-decision-events.ts
main parses arguments before checking the sync kill switch. Invalid arguments are reported even when syncing is disabled; valid disabled invocations still return 0.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: Minimal · up to 653e1

Disabled sync invocations with invalid arguments now fail with a usage error, while valid disabled runs remain no-ops. The change is small and easily reversible; a regression test for the ordering is a worthwhile follow-up.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dezren39

Copy link
Copy Markdown
Member Author

agent-note:v1 — Codex disposition (lane code-b, fallback mode)

Codex gate: the Codex review on this PR FAILED with the usage-limit message ("You have reached your Codex usage limits for code reviews") and produced zero findings — the same repo-wide Codex usage-limit failure seen throughout today. No Codex finding exists to disposition. (This PR itself fixes a Codex P1 from PR #9341 that did get reviewed before the limits hit.)

Verification is behavioral and recorded in the PR body: disabled+invalid now exits 2, disabled+valid exits 0 as a no-op, enabled paths unchanged, decision-events tests pass. Merging under the standing criteria once GitHub reports mergeable.

@dezren39
dezren39 merged commit 1bd2c80 into main Nov 14, 2026
1 check failed
@dezren39
dezren39 deleted the queue/fallback-9794-killswitch branch November 14, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pm-stack: sync-decision-events kill switch returns 0 before parseArgs, so invalid args silently succeed (from PR #9341)

1 participant